package a.a;

import a.c.ab;
import a.c.bb;
import a.c.d;
import a.c.e;
import a.c.n;
import a.c.q;
import a.c.w;
import a.c.*;
import a.c.z;
import a.i.db;
import a.i.i;

public class m
{
  public static boolean a;
  public static int b;
  
  public static bb[] a(q paramq)
  {
    x localx = db.a(new int[paramq.j()]);
    return a(paramq, localx, a(paramq, localx));
  }
  
  public static int a(q paramq, x paramx)
  {
    int j = b;
    boolean bool = a;
    w localw1 = paramq.v();
    do
    {
      do
      {
        if (!localw1.e()) {
          break;
        }
        paramx.a(localw1.d(), -1);
        localw1.f();
      } while (!bool);
    } while (j != 0);
    int i = 0;
    i locali = new i(paramq.j());
    w localw2 = paramq.v();
    do
    {
      if (!localw2.e()) {
        break;
      }
      e locale = localw2.d();
      if ((j == 0) && (bool)) {
        break label138;
      }
      if (paramx.getInt(locale) == -1) {
        a(locale, locali, paramx, i++);
      }
      localw2.f();
    } while (!bool);
    label138:
    return i;
  }
  
  public static ab b(q paramq)
  {
    int j = b;
    boolean bool = a;
    ab localab = new ab();
    bb[] arrayOfbb = a(paramq);
    int i = 0;
    do
    {
      if (i >= arrayOfbb.length - 1) {
        break;
      }
      d locald = paramq.a(arrayOfbb[i].m(), arrayOfbb[(i + 1)].n());
      if (j == 0)
      {
        if (bool) {
          break label79;
        }
        localab.add(locald);
        i++;
      }
    } while (!bool);
    label79:
    return localab;
  }
  
  public static bb[] a(q paramq, x paramx, int paramInt)
  {
    int j = b;
    boolean bool = a;
    bb[] arrayOfbb = new bb[paramInt];
    int i = 0;
    do
    {
      while (!bool)
      {
        if (i >= paramInt) {
          break;
        }
        arrayOfbb[i] = new bb();
        i++;
      }
    } while (j != 0);
    w localw = paramq.v();
    do
    {
      while (!bool)
      {
        if (!localw.e()) {
          break;
        }
        if ((j == 0) && (bool)) {
          break label118;
        }
        arrayOfbb[paramx.getInt(localw.d())].b(localw.d());
        localw.f();
      }
    } while (j != 0);
    label118:
    return arrayOfbb;
  }
  
  public static boolean c(q paramq)
  {
    int i = b;
    if (i == 0) {
      if (paramq.n()) {
        return true;
      }
    }
    if (i == 0)
    {
      if (paramq.l() < paramq.j() - 1) {
        return false;
      }
      if (i != 0) {
        break label58;
      }
    }
    label58:
    return a(paramq, db.a(new int[paramq.j()])) <= 1;
  }
  
  private static void a(e parame, i parami, x paramx, int paramInt)
  {
    int i = b;
    boolean bool = a;
    parami.a(parame);
    paramx.a(parame, paramInt);
    break label116;
    if (!parami.f()) {
      parame = (e)parami.b();
    }
    label44:
    label46:
    label116:
    while (i != 0)
    {
      d locald = parame.h();
      e locale;
      if (locald != null)
      {
        locale = locald.f();
        if (i != 0) {
          break label139;
        }
        if (bool) {
          break label137;
        }
      }
      while (bool)
      {
        if (paramx.getInt(locale) == -1)
        {
          paramx.a(locale, paramInt);
          parami.a(locale);
        }
        locald = locald.i();
        if (!bool) {
          break label44;
        }
        if (i != 0) {
          break label46;
        }
        locald = parame.i();
        if (locald == null) {
          break;
        }
        locale = locald.e();
      }
      if (paramx.getInt(locale) == -1)
      {
        paramx.a(locale, paramInt);
        parami.a(locale);
      }
      locald = locald.j();
      if (!bool) {
        break;
      }
    }
    label137:
    label139:
    return;
  }
  
  public static ab[] d(q paramq)
  {
    n localn = db.b(new int[paramq.l()]);
    int i = a(paramq, localn);
    return a(paramq, localn, i);
  }
  
  public static int a(q paramq, n paramn)
  {
    return a(paramq, paramn, db.a(new boolean[paramq.j()]));
  }
  
  public static int a(q paramq, n paramn, x paramx)
  {
    a_ locala_ = new a_(paramn, paramx);
    locala_.a(paramq);
    return locala_.r;
  }
  
  public static ab[] a(q paramq, n paramn, int paramInt)
  {
    int k = b;
    boolean bool = a;
    ab[] arrayOfab = new ab[paramInt];
    int i = 0;
    do
    {
      while (!bool)
      {
        if (i >= paramInt) {
          break;
        }
        arrayOfab[i] = new ab();
        i++;
      }
    } while (k != 0);
    a.c.m localm = paramq.w();
    do
    {
      if (!localm.e()) {
        break;
      }
      int j = paramn.getInt(localm.a());
      if (k == 0)
      {
        if (j > -1) {
          arrayOfab[j].add(localm.a());
        }
        localm.f();
      }
    } while (!bool);
    return arrayOfab;
  }
  
  public static ab e(q paramq)
  {
    int k = b;
    boolean bool = a;
    ab localab = new ab();
    x localx = db.a(new boolean[paramq.j()]);
    n localn = db.b(new int[paramq.l()]);
    int i = a(paramq, localn, localx);
    ab[] arrayOfab = a(paramq, localn, i);
    if (arrayOfab.length > 1)
    {
      bb localbb = new bb();
      int j = 0;
      Object localObject2;
      label255:
      do
      {
        if (j >= arrayOfab.length) {
          break;
        }
        localObject2 = arrayOfab[j];
        e locale = null;
        if (bool) {
          break label466;
        }
        d locald;
        if (((ab)localObject2).size() == 1)
        {
          locald = ((ab)localObject2).m();
          if (k == 0) {
            if (a(locald.e(), true))
            {
              locale = locald.e();
              break label390;
            }
          }
          if ((k != 0) || (a(locald.f(), false))) {
            locale = locald.f();
          }
        }
        else
        {
          a.c.m localm = ((ab)localObject2).l();
          do
          {
            if (!localm.e()) {
              break label329;
            }
            locald = localm.a();
            if (bool) {
              break;
            }
            if (localx.getBool(locald.e()))
            {
              if (k == 0) {
                if (locale == null)
                {
                  locale = locald.e();
                  if (k != 0) {
                    break label266;
                  }
                  if (!bool) {
                    break label255;
                  }
                }
              }
              if (locale != locald.e())
              {
                locale = null;
                break label329;
              }
            }
            if (k == 0)
            {
              if (localx.getBool(locald.f()))
              {
                if (k == 0) {
                  if (locale == null)
                  {
                    locale = locald.f();
                    if (k != 0) {
                      continue;
                    }
                    if (!bool) {
                      break label317;
                    }
                  }
                }
                if (locale != locald.f())
                {
                  locale = null;
                  break label329;
                }
              }
              localm.f();
            }
          } while (!bool);
          if (k != 0) {
            break label416;
          }
          if (k != 0) {
            break label392;
          }
          if (locale != null)
          {
            locald = ((ab)localObject2).m();
            if (k == 0) {
              if (locald.e() != locale)
              {
                if (k != 0) {
                  break label392;
                }
                locale = locald.e();
                if (!bool) {
                  break label390;
                }
              }
            }
            locale = locald.f();
          }
        }
        if (locale != null) {
          localbb.add(locale);
        }
        j++;
      } while (!bool);
      label266:
      label317:
      label329:
      Object localObject1 = localbb.o();
      label390:
      label392:
      label416:
      do
      {
        if (localbb.isEmpty()) {
          break;
        }
        localObject2 = localbb.o();
        if (k == 0)
        {
          if (bool) {
            break label466;
          }
          localab.c(paramq.a((e)localObject1, (e)localObject2));
          localObject1 = localObject2;
        }
      } while (!bool);
    }
    label466:
    return localab;
  }
  
  private static boolean a(e parame, boolean paramBoolean)
  {
    int i = b;
    boolean bool = a;
    if (i == 0) {
      if (parame.c() == 1) {
        return true;
      }
    }
    d locald;
    if (i == 0)
    {
      if (paramBoolean)
      {
        if (i == 0) {
          if (parame.e() - parame.d() != 1) {
            return false;
          }
        }
        locald = parame.i();
        do
        {
          if (locald == null) {
            break;
          }
          if (bool) {
            break label141;
          }
          if (!locald.g()) {
            return false;
          }
          locald = locald.j();
        } while (!bool);
      }
      if (i != 0) {}
    }
    else if (parame.d() - parame.e() != 1)
    {
      return false;
    }
    while (i != 0) {
      for (locald = parame.h(); !bool; locald = locald.i())
      {
        if (locald == null) {
          break;
        }
        if (bool) {
          break label141;
        }
        if (!locald.g()) {
          return false;
        }
      }
    }
    label141:
    return true;
  }
  
  public static boolean f(q paramq)
  {
    if (b == 0) {}
    return a(paramq, db.b(new int[paramq.l()])) <= 1;
  }
  
  public static void a(q paramq, e parame, boolean paramBoolean, boolean[] paramArrayOfBoolean)
  {
    int j = b;
    boolean bool = a;
    int i = 0;
    if (i < paramArrayOfBoolean.length)
    {
      paramArrayOfBoolean[i] = false;
      i++;
    }
    for (;;)
    {
      if ((j != 0) || (!bool))
      {
        if (!bool) {
          break;
        }
        if (j == 0) {
          a(parame, paramBoolean, paramArrayOfBoolean);
        }
      }
    }
  }
  
  public static void a(q paramq, e parame, boolean paramBoolean, boolean[] paramArrayOfBoolean1, boolean[] paramArrayOfBoolean2)
  {
    int j = b;
    boolean bool = a;
    int i = 0;
    if (i < paramArrayOfBoolean2.length)
    {
      paramArrayOfBoolean2[i] = false;
      i++;
    }
    for (;;)
    {
      if ((j != 0) || (!bool))
      {
        if (!bool) {
          break;
        }
        if (j == 0) {
          a(parame, paramBoolean, paramArrayOfBoolean1, paramArrayOfBoolean2);
        }
      }
    }
  }
  
  public static bb a(q paramq, bb parambb, int paramInt)
  {
    return a(paramq, parambb, paramInt, 1);
  }
  
  public static bb b(q paramq, bb parambb, int paramInt)
  {
    return a(paramq, parambb, paramInt, -1);
  }
  
  public static bb c(q paramq, bb parambb, int paramInt)
  {
    return a(paramq, parambb, paramInt, 0);
  }
  
  private static bb a(q paramq, bb parambb, int paramInt1, int paramInt2)
  {
    int j = b;
    boolean bool = a;
    bb localbb1 = new bb();
    x localx = db.a(new boolean[paramq.j()]);
    if (j == 0)
    {
      if (!paramq.n()) {
        if (j != 0) {
          break label395;
        }
      }
    }
    else {
      label388:
      label390:
      if (!parambb.isEmpty())
      {
        bb localbb2 = new bb();
        w localw1 = parambb.l();
        Object localObject;
        do
        {
          do
          {
            if (!localw1.e()) {
              break;
            }
            localObject = localw1.d();
            localx.a(localObject, true);
            if (j != 0) {
              break label395;
            }
            localbb2.b(localObject);
            localw1.f();
            if (bool) {
              break label393;
            }
          } while (!bool);
        } while (j != 0);
        int i = 1;
        label272:
        label341:
        label365:
        do
        {
          do
          {
            if ((localbb2.isEmpty()) || (paramInt1-- < 0)) {
              break label393;
            }
            localObject = localbb2;
            localbb2 = new bb();
            w localw2 = ((bb)localObject).l();
            do
            {
              do
              {
                if (!localw2.e()) {
                  break;
                }
                e locale1 = localw2.d();
                if (bool) {
                  break label365;
                }
                d locald;
                e locale2;
                if (paramInt2 >= 0)
                {
                  locald = locale1.h();
                  do
                  {
                    if (locald == null) {
                      break;
                    }
                    locale2 = locald.f();
                    if (bool) {
                      break label272;
                    }
                    if (!localx.getBool(locale2))
                    {
                      localx.a(locale2, true);
                      localbb2.b(locale2);
                    }
                    locald = locald.i();
                  } while (!bool);
                }
                if (j == 0)
                {
                  if (paramInt2 <= 0)
                  {
                    locald = locale1.i();
                    do
                    {
                      if (locald == null) {
                        break label341;
                      }
                      locale2 = locald.e();
                      if (bool) {
                        break;
                      }
                      if (!localx.getBool(locale2))
                      {
                        localx.a(locale2, true);
                        localbb2.b(locale2);
                      }
                      locald = locald.j();
                    } while (!bool);
                  }
                  localw2.f();
                }
              } while (j != 0);
            } while (!bool);
            if (j != 0) {
              break label388;
            }
            if (i == 0) {
              break;
            }
            i = 0;
            if (j != 0) {
              break label390;
            }
          } while (!bool);
          localbb1.a((z)localObject);
        } while (!bool);
      }
    }
    label393:
    label395:
    return localbb1;
  }
  
  private static void a(e parame, boolean paramBoolean, boolean[] paramArrayOfBoolean1, boolean[] paramArrayOfBoolean2)
  {
    int j = b;
    boolean bool = a;
    paramArrayOfBoolean2[parame.f()] = true;
    a.c.m localm = paramBoolean ? parame.n() : parame.l();
    do
    {
      if (!localm.e()) {
        break;
      }
      d locald = localm.a();
      if (paramArrayOfBoolean1[locald.d()] == 0)
      {
        e locale = locald.a(parame);
        int i = locale.f();
        if (j != 0) {
          continue;
        }
        if (paramArrayOfBoolean2[i] == 0) {
          a(locale, paramBoolean, paramArrayOfBoolean1, paramArrayOfBoolean2);
        }
      }
      localm.f();
    } while (!bool);
  }
  
  private static void a(e parame, boolean paramBoolean, boolean[] paramArrayOfBoolean)
  {
    int j = b;
    boolean bool = a;
    paramArrayOfBoolean[parame.f()] = true;
    w localw = paramBoolean ? parame.q() : parame.o();
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      int i = locale.f();
      if (j == 0)
      {
        if (paramArrayOfBoolean[i] == 0) {
          a(locale, paramBoolean, paramArrayOfBoolean);
        }
        localw.f();
      }
    } while (!bool);
  }
  
  private static void a(e parame, boolean[] paramArrayOfBoolean, int paramInt)
  {
    int j = b;
    boolean bool = a;
    if (j == 0)
    {
      if (paramInt <= 0) {
        return;
      }
      paramArrayOfBoolean[parame.f()] = true;
    }
    d locald = parame.i();
    do
    {
      if (locald == null) {
        break;
      }
      e locale = locald.e();
      int i = locale.f();
      if (j == 0)
      {
        if (paramArrayOfBoolean[i] == 0) {
          a(locale, paramArrayOfBoolean, paramInt - 1);
        }
        locald = locald.j();
      }
    } while (!bool);
  }
  
  private static void c(e parame, boolean[] paramArrayOfBoolean, int paramInt)
  {
    int j = b;
    boolean bool = a;
    if (j == 0)
    {
      if (paramInt <= 0) {
        return;
      }
      paramArrayOfBoolean[parame.f()] = true;
    }
    d locald = parame.h();
    do
    {
      if (locald == null) {
        break;
      }
      e locale = locald.f();
      int i = locale.f();
      if (j == 0)
      {
        if (paramArrayOfBoolean[i] == 0) {
          c(locale, paramArrayOfBoolean, paramInt - 1);
        }
        locald = locald.i();
      }
    } while (!bool);
  }
  
  private static void e(e parame, boolean[] paramArrayOfBoolean, int paramInt)
  {
    int j = b;
    boolean bool = a;
    if (j == 0)
    {
      if (paramInt <= 0) {
        return;
      }
      paramArrayOfBoolean[parame.f()] = true;
    }
    d locald = parame.h();
    e locale;
    int i;
    do
    {
      do
      {
        if (locald == null) {
          break;
        }
        locale = locald.f();
        i = locale.f();
        if (bool) {
          break label111;
        }
        if (paramArrayOfBoolean[i] == 0) {
          e(locale, paramArrayOfBoolean, paramInt - 1);
        }
        locald = locald.i();
      } while (!bool);
    } while (j != 0);
    locald = parame.i();
    label111:
    do
    {
      if (locald == null) {
        break;
      }
      locale = locald.e();
      i = locale.f();
      if (paramArrayOfBoolean[i] == 0) {
        e(locale, paramArrayOfBoolean, paramInt - 1);
      }
      locald = locald.j();
    } while (!bool);
  }
  
  public static bb[] g(q paramq)
  {
    x localx = db.a(new int[paramq.j()]);
    return a(paramq, localx, b(paramq, localx));
  }
  
  public static int b(q paramq, x paramx)
  {
    int i = b;
    boolean bool = a;
    w localw = paramq.v();
    do
    {
      do
      {
        if (!localw.e()) {
          break;
        }
        paramx.a(localw.d(), -1);
        localw.f();
      } while (!bool);
    } while (i != 0);
    return c(paramq, paramx);
  }
  
  public static boolean h(q paramq)
  {
    if (b == 0) {}
    return b(paramq, db.a(new int[paramq.j()])) <= 1;
  }
  
  private static int c(q paramq, x paramx)
  {
    int i1 = b;
    boolean bool = a;
    boolean[] arrayOfBoolean1 = new boolean[paramq.j()];
    boolean[] arrayOfBoolean2 = new boolean[paramq.j()];
    int[] arrayOfInt = new int[paramq.j()];
    d[] arrayOfd = new d[paramq.j()];
    i locali1 = new i(paramq.j());
    i locali2 = new i(paramq.j());
    i locali3 = new i(paramq.j());
    int i = 1;
    int j = 0;
    w localw = paramq.v();
    label171:
    label172:
    label245:
    label506:
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale1 = localw.d();
      int k = locale1.f();
      if (bool) {
        break label601;
      }
      if (arrayOfInt[k] == 0)
      {
        arrayOfInt[k] = i;
        i++;
        locali1.a(locale1);
        arrayOfBoolean1[k] = true;
        locali2.a(locale1);
        locali3.a(locale1);
        arrayOfBoolean2[k] = true;
        break label385;
        do
        {
          do
          {
            if (locali1.f()) {
              break label587;
            }
            int n;
            do
            {
              e locale2 = (e)locali1.a();
              int m = locale2.f();
              d locald;
              if (arrayOfd[m] == null)
              {
                locald = arrayOfd[m] =  = locale2.h();
                if (i1 == 0) {
                  if (!bool) {
                    break label245;
                  }
                }
              }
              else
              {
                locald = arrayOfd[m].i();
              }
              arrayOfd[m] = locald;
              if (i1 == 0) {
                if (locald != null)
                {
                  locale3 = locald.f();
                  n = locale3.f();
                  if (i1 == 0) {
                    if (arrayOfInt[n] == 0)
                    {
                      arrayOfInt[n] = i;
                      i++;
                      locali1.a(locale3);
                      arrayOfBoolean1[n] = true;
                      locali3.a(locale3);
                      arrayOfBoolean2[n] = true;
                      locali2.a(locale3);
                      if ((i1 == 0) && (!bool)) {
                        break label172;
                      }
                    }
                  }
                  if (i1 == 0) {
                    if (arrayOfBoolean1[n] != 0)
                    {
                      if (i1 != 0) {
                        break label419;
                      }
                      if (arrayOfInt[n] <= arrayOfInt[m]) {
                        break label400;
                      }
                    }
                  }
                  if (((i1 == 0) && (arrayOfBoolean1[n] != 0)) || (arrayOfInt[n] >= arrayOfInt[m])) {
                    break label172;
                  }
                  break label506;
                  if ((i1 == 0) && (arrayOfBoolean2[n] == 0)) {
                    break label172;
                  }
                  if (arrayOfInt[n] >= arrayOfInt[((e)locali2.a()).f()]) {
                    break label172;
                  }
                  locali2.b();
                  if (i1 != 0) {
                    break label596;
                  }
                  if (bool) {
                    break label594;
                  }
                  if (!bool) {
                    break label171;
                  }
                }
              }
              e locale3 = (e)locali1.b();
              n = locale3.f();
              arrayOfBoolean1[n] = false;
              if (i1 != 0) {
                break;
              }
              if (locale3 != locali2.a()) {
                break label172;
              }
            } while ((i1 != 0) || (i1 != 0) || (bool));
            locali2.b();
            do
            {
              if (locali3.f()) {
                break label569;
              }
              if (bool) {
                break;
              }
              if (arrayOfInt[n] > arrayOfInt[((e)locali3.a()).f()]) {
                break label569;
              }
              e locale4 = (e)locali3.b();
              arrayOfBoolean2[locale4.f()] = false;
              paramx.a(locale4, j);
            } while (!bool);
            j++;
            if (i1 != 0) {
              break label171;
            }
          } while (i1 != 0);
        } while (!bool);
      }
      localw.f();
    } while (!bool);
    label385:
    label400:
    label419:
    label569:
    label587:
    label594:
    label596:
    label601:
    return j;
  }
  
  static class a_
    extends h
  {
    int[] l;
    int[] m;
    i n;
    n o;
    x p;
    boolean q;
    int r;
    
    a_(n paramn, x paramx)
    {
      this.p = paramx;
      this.o = paramn;
      this.q = false;
    }
    
    public void a(q paramq)
    {
      this.l = new int[paramq.k()];
      this.m = new int[paramq.k()];
      this.n = new i(paramq.l());
      super.a(paramq);
    }
    
    protected void a(e parame, int paramInt)
    {
      int tmp17_16 = paramInt;
      this.l[parame.f()] = tmp17_16;
      this.m[parame.f()] = tmp17_16;
    }
    
    protected void a(d paramd, e parame, boolean paramBoolean)
    {
      int i = m.b;
      this.n.a(paramd);
      if (i == 0)
      {
        if (paramBoolean) {
          return;
        }
        if (i != 0) {}
      }
      else if (paramd.g())
      {
        this.o.a(paramd, -1);
        this.n.b();
        if (!m.a) {
          return;
        }
      }
      e locale = paramd.a(parame);
      this.l[locale.f()] = Math.min(this.l[locale.f()], this.m[parame.f()]);
    }
    
    protected void a(e parame)
    {
      this.q = false;
    }
    
    protected void a(d paramd, e parame)
    {
      int i = m.b;
      boolean bool = m.a;
      e locale = paramd.a(parame);
      if (i == 0) {
        if (this.l[parame.f()] >= this.m[locale.f()])
        {
          do
          {
            if (this.n.a() == paramd) {
              break;
            }
            this.o.a(this.n.b(), this.r);
            if (i != 0) {
              break label135;
            }
            if (bool) {
              break label123;
            }
          } while (!bool);
          this.o.a(this.n.b(), this.r);
          if (i == 0)
          {
            this.r += 1;
            label123:
            if (i != 0) {
              break label187;
            }
            label135:
            if (!this.n.f()) {
              break label186;
            }
            if (i != 0) {
              break label183;
            }
            if (this.q)
            {
              this.p.a(locale, true);
              if (i != 0) {
                return;
              }
              if (!bool) {
                break label197;
              }
            }
          }
          this.q = true;
          if (i != 0) {
            return;
          }
          if (bool) {
            label183:
            label186:
            label187:
            this.p.a(locale, true);
          }
        }
      }
      label197:
      this.l[locale.f()] = Math.min(this.l[locale.f()], this.l[parame.f()]);
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.a.m

 * JD-Core Version:    0.7.0.1

 */